//
//  ZJRunModel.swift
//  mini
//
//  Created by Mac on 2017/5/22.
//  Copyright © 2017年 Mac. All rights reserved.
//

import UIKit
import HandyJSON

struct ZJRunModel: HandyJSON {

     var did:String?
     var steps:String?
     var distance:String?
     var calories:String?
     var measuretime:String?
     var isUpLoad:Bool = false
    
    init() {
        
        did = ""
        steps = "0"
        distance = "0"
        calories = "0"
        measuretime = "2017-05-22"
        isUpLoad = false
    }
    
    
    func getRunModelData(response:Any) -> [ZJRunModel] {
        
        if let arrayString = response as? NSArray {
            
            let tempArray:[ZJRunModel]  = arrayString.map({ dic in
                
                let object: ZJRunModel = JSONDeserializer<ZJRunModel>.deserializeFrom(dict: dic as? NSDictionary)!
                return object
            })
            
            return tempArray
        }
        
        
        var model:ZJRunModel = ZJRunModel()
        model.did = ""
        model.steps = "0"
        model.distance = "0"
        model.calories = "0"
        model.measuretime = "2017-05-22"
        model.isUpLoad = false
        return [model]
    }
    

}
